//
//  NetworkCommand.h
//  walletSDK
//
//  Created by xuyf on 13-6-17.
//  Copyright (c) 2013年 LianLian. All rights reserved.
//

#import <Foundation/Foundation.h>

#define kLLWalletSDKVersion @"1.0"

typedef void (^LLNetworkHandleBlock)(NSDictionary *dic);
typedef void (^LLNetworkHandleErrorBlock)(NSError *error);

@interface LLNetworkCommand : NSObject

- (NSDictionary*)functionInfoDic;
@property (nonatomic, retain) NSString *functionName;
@property (nonatomic, retain) NSString *transCode;
@property (nonatomic, retain) NSString *pathUrl;

@property (nonatomic, retain) NSMutableDictionary *paramDic;
@property (nonatomic, assign) BOOL needTraderNO;
@property (nonatomic, assign) BOOL needToken;

@property (nonatomic, copy) LLNetworkHandleBlock businessSuccessHandler;
@property (nonatomic, copy) LLNetworkHandleBlock businessErrorHandler;

@property (nonatomic, copy) LLNetworkHandleErrorBlock errorHandler;

@property (nonatomic, assign) BOOL useSystemErrorAlert;
@property (nonatomic, retain) NSString *systemErrorAlertTip;

@property (nonatomic, assign) BOOL useSystemHold;
@property (nonatomic, retain) NSString *systemHoldTip;  // 假如为nil, 则使用系统默认提示语
@property (nonatomic, assign) BOOL isGet;

// Timeout interval

@property(nonatomic,getter=isTestMode) BOOL testMode;

- (BOOL)isTestSecureMode;

- (BOOL)isGetMethod;
+ (id)cmd;

- (void)prepareParamDic;
- (void)urlEncodeParamDic;

- (NSString*)valueWithKey:(NSString*)paramKey;

- (void)prepareForSend;

- (NSString*)signKeyTitle;

- (NSString*)signKey; // 重写时需要考虑test和release两个key
- (NSString*)ver_app;
- (NSString*)signature;

- (BOOL)isUseCmdResultParser;
- (void)handleResultObj:(id)jsonObj;
@end
